package com.demo.springcloud.netflix.erureka;

import feign.Response;
import feign.codec.ErrorDecoder;

/**
 * Openfeign Error Decoder
 * 
 * @author xiaojianhx
 * @version V1.0.0 $ 2023-11-16 13:28:47 init ---- xiaojianhx
 */
public class OpenfeignErrorDecoder implements ErrorDecoder {

    public Exception decode(String methodKey, Response response) {

        System.out.println(methodKey);
        System.out.println(response.status());
        System.out.println(response.reason());
        System.out.println(response.body().toString());
        return new Exception(response.body().toString());
    }
}